<?php

/**
 * Auspice form base class.
 *
 * @method Auspice getObject() Returns the current form's model object
 *
 * @package    rpgcom
 * @subpackage form
 * @author     Your name here
 */
abstract class BaseAuspiceForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'idAuspice'    => new sfWidgetFormInputHidden(),
      'name'         => new sfWidgetFormInputText(),
      'description'  => new sfWidgetFormTextarea(),
      'idSupplement' => new sfWidgetFormPropelChoice(array('model' => 'Supplement', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'idAuspice'    => new sfValidatorPropelChoice(array('model' => 'Auspice', 'column' => 'idAuspice', 'required' => false)),
      'name'         => new sfValidatorString(array('max_length' => 50)),
      'description'  => new sfValidatorString(),
      'idSupplement' => new sfValidatorPropelChoice(array('model' => 'Supplement', 'column' => 'idSupplement')),
    ));

    $this->validatorSchema->setPostValidator(
      new sfValidatorPropelUnique(array('model' => 'Auspice', 'column' => array('name')))
    );

    $this->widgetSchema->setNameFormat('auspice[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'Auspice';
  }


}
